import { Injectable } from '@nestjs/common';
import { User } from '../entity/user.entity';
import { Repository } from 'typeorm';
import { InjectRepository } from '@nestjs/typeorm';


let res = {
  code: 200,
  msg: '请求成功',
  data: null
}

@Injectable()
export class UserService {

  constructor(
    @InjectRepository(User) private readonly userRepository : Repository<User> , // 使用用户表
  ){
  }
  async getList(){
    let data = await this.userRepository.find();
    res.data = data
    return res
  }
}
